/* Reset default margins/padding */
* {
  margin: 0;
  padding: 2px;
  box-sizing: border-box;
}

.gallery-title {
  text-align: center;
  padding: 1em;
  font-weight: lighter;
  font-size: 22px;
  color: #333;
  font-family: Arial, Helvetica, sans-serif;
  letter-spacing: 8px;
}

body.dark-mode .gallery-title {
  color: #fbfbfb;
}

/* Gallery container takes full width */
.gallery {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
}

/* Each image container */
.gallery-item {
  flex: 1 0 33%;
  /* Show max of 3 images per row */
  position: relative;
  overflow: hidden;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery-item img:hover {
  transform: scale(1.05);
}

/* Modal full screen overlay */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 1);
  align-items: center;
  justify-content: center;
}

/* Modal image styling */
.modal img {
  max-width: 90%;
  max-height: 90%;
}

/* Close button styling */
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #696969;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
}

/* Modal Nav Arrows */
.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #696969;
  padding: 10px;
  cursor: pointer;
  user-select: none;
  z-index: 1001;
  transition: background 0.3s;
}

.arrow:hover {
  background: rgba(58, 58, 58, 0.1);
}

.arrow.left {
  left: 20px;
}

.arrow.right {
  right: 20px;
}

/* Dark mode toggle button */
.dark-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #222;
  color: #fbfbfb;
  border: none;
  border-radius: 20px;
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  z-index: 2000;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}

/* Dark mode styles */
body.dark-mode {
  background-color: #111111;
  color: #fbfbfb;
}

body.dark-mode .dark-toggle {
  background: #fbfbfb;
  color: #000;
}

/* Dark mode: modal background */
body.dark-mode .modal {
  background-color: rgba(0, 0, 0, 0.95);
}

/* Dark mode: arrows */
body.dark-mode .arrow {
  color: #fbfbfb;
}

body.dark-mode .arrow:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Dark mode: close button */
body.dark-mode .close {
  color: #fbfbfb;
}


@media (max-width: 768px) {
  .gallery-item {
    flex: 1 0 50%;
    /* 2 images per row on smaller screens */
  }
}

@media (max-width: 480px) {
  .gallery-item {
    flex: 1 0 100%;
    /* 1 image per row on very small screens */
  }
}

.gallery-item-full-width {
  flex: 1 0 100%; /* Span full row */
  max-width: 100%;
}

.gallery-item-full-width img {
  width: 100%;
  height: auto;
  display: block;
}

.footer {
  text-align: center;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 12px;
  margin: 1%;
  padding: 1%;
}